<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>汽车对象</title>
	</head>
	<body>
		<h1>保时捷718 Cayman T,红色 ,641000元</h1>
		<script>
			//js对象
			//var car=new Object();//标准写法
			
			var car={
				name:"保时捷719",
				note:"这个车很不错",
				toString:function(){  //初始化时定义一个方法
					return this.name+","+this.note;		
				}
			}
			
			//定义属性(动态添加属性)
			//car.name="保时捷718";
			console.log(car);//直接打印对象,直接观察
			
			car.type="Cayman T";
			car.color="红色";
			car.price=641000;
			
			car.show=function(){
				return this.name+","+this.type+","+this.color+","+this.price;
			}
			console.log(car);
			console.log(car.toString())
			console.log(car.show())
		</script>
	</body>
</html>
